import java.util.Arrays;



public class Test_9_2 {

    public static void selectSort(int[] array) {
        for(int i = 0; i < array.length-1; i++) {
            int minIndex = i;
            for(int j = i+1; j < array.length; j++) {
                if(array[j] < array[minIndex]) {
                    minIndex = j;
                }
            }
            int tmp = array[i];
            array[i] = array[minIndex];
            array[minIndex] = tmp;
        }
    }


    public static void main(String[] args) {
        int[] array = {1,5,9,-1,99,6,2,14,10,88};
        selectSort(array);
        System.out.println(Arrays.toString(array));
    }
}
